﻿#region

using System;
using System.ComponentModel;
using System.Windows.Forms;
using EditeurSyntaxiqueVocal.Class;

#endregion

namespace EditeurSyntaxiqueVocal.Forms
{
    public class DragForm : Form
    {
        private BackgroundWorker backgroundWorker1;
        private IContainer components;

        public DragForm()
        {
            FormBorderStyle = FormBorderStyle.None;
            ShowInTaskbar = false;
            SetStyle(ControlStyles.Selectable, false);
            //  Enabled = false;
        }

        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams createParams = base.CreateParams;
                createParams.ExStyle |= (int) WindowExStyles.WS_EX_TOOLWINDOW;
                return createParams;
            }
        }

        protected override void WndProc(ref Message m)
        {
            if (m.Msg == (int) Msgs.WM_NCHITTEST)
            {
                m.Result = (IntPtr) HitTest.HTTRANSPARENT;
                return;
            }

            base.WndProc(ref m);
        }

        public virtual void Show(bool bActivate)
        {
            if (bActivate)
                Show();
            //else
              //  NativeMethods.ShowWindow(Handle, (int) ShowWindowStyles.SW_SHOWNOACTIVATE);
        }

        private void InitializeComponent()
        {
            this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
            this.SuspendLayout();
            // 
            // DragForm
            // 
            this.ClientSize = new System.Drawing.Size(292, 266);
            this.Name = "DragForm";
            this.ResumeLayout(false);

        }
    }
}